function [ D ] = updateTopology( pdir, pev )
%UPDATETOPOLOGY Summary of this function goes here
%   Detailed explanation goes here

pev(pev<39) = 0;

pev = pev / 100;

n = size(pev, 1);

for i = 1 : n
   pdir(i, :) = pdir(i, :) * pev(i); 
end

vec = reshape(pdir', n*2, 1);

[oconf, overt, oedge, onormal, olength, ovnormal] = ElTopoWraper([0; n; 0.5], vec);

oedge = oedge + 1;

nV = oconf(1);
nE = oconf(2);

D = struct('vx', overt(1:2:2*nV), 'vy', overt(2:2:2*nV), 'e1', oedge(1:2:2*nE), 'e2', oedge(2:2:2*nE), 'nx', onormal(1:2:2*nE), 'ny', onormal(2:2:2*nE), 'vnx', ovnormal(1:2:2*nV), 'vny', ovnormal(2:2:2*nV), 'l', olength);

end

